package com.controller;

import com.common.Result;
import com.entity.Letter;
import com.service.LetterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * User的路由接口服务
 * 
 * @author 
 *
 */
@RestController
@RequestMapping("pcApi")
public class LetterController {

	/** UserService服务 */
	@Autowired
	private LetterService letterService;


	/**
	 * 写信
	 * @param bean
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/letter/create", produces = {"application/json;charset=UTF-8"})
	public Result create(@RequestBody Letter bean){
		return letterService.create(bean);
	}

	/**
	 * 分页查询
	 * @param bean
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/letter/index", produces = {"application/json;charset=UTF-8"})
	public  Result index(@RequestBody Letter bean){
		return letterService.index(bean);
	}

	/**
	 * 单个查询
	 * @param bean
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/letter/findOne", produces = {"application/json;charset=UTF-8"})
	public Letter findOne(@RequestBody Letter bean){
		return letterService.findOne(bean);
	}


}
